package com.kaifamiao.base.Demo20210927;

import java.io.*;

/**
 * @author lucien-ma
 * @date 2021/9/27
 * @apiNote
 */
public class SerializableDemo {

    public static void main(String[] args) {
        try (
                FileOutputStream fileOutputStream = new FileOutputStream("E:/test/student.txt");
                ObjectOutputStream objectOutputStream = new ObjectOutputStream(fileOutputStream);
        ) {
            Student student = new Student("张三", 89.6, "男");
            objectOutputStream.writeObject(student);
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
